1. Field of Invention
The present invention relates to an apparatus and a method of data processing, system. More particularly, the present invention relates to an apparatus and a method of data processing system that uses multiply-accumulate instructions. The data processing system can easily detect an overflow case and simplify calculations to save execution time.
2. Description of Related Art
In the field of data processing, it is necessary to be able to perform certain operations upon operands stored in various data registers. One such operation is to multiply an N-bit operand by a second N-bit operand and add a third N-bit operand to the result. Another similar operation is to multiply an N-bit operand by a second N-bit operand and add a 2N-bit operand to the result.
FIG. 1 is a block diagram showing a conventional multiply-accumulator unit for a data processing system in U.S. Pat. No. 5,583,804, titled “DATA PROCESSING USING MULTIPLY-ACCUMULATE INSTRUCTIONS”. This system is capable of performing a first class of multiply-accumulate instructions in the form of N*N+2N→2N, and a second class of multiply-accumulate instructions in the form of N*N+N→N.
The multiply-accumulator unit comprises a first data register 10, a second data register 20, an N*N multiplier 30, an N+N accumulator 40, and a 2N+2N accumulator 50. The multiplier 30 is capable of calculating N*N to get an N or a 2N result. The N+N accumulator 40 is capable of calculating N+N to get an N result. The 2N+2N accumulator 50 is capable of calculating 2N+2N to get a 2N result.
However, it is possible while performing an operation on an N*N+N→N class instruction, that the final N result is greater than can be represented in a result of N-bit size. It is important when this situations happens, that the user be made aware that an overflow condition has occurred in the operation. A disadvantage of the multiply-accumulator unit of FIG. 1 is the unit's inability to show this overflow condition. To provide this critical information to the user in as efficient manner as possible is one reason the multiply-accumulator unit of the present invention was developed.